package org.jeecg.modules.demo.util;

public class FileUtil {

    public static String convertDecimalToHexBigEndian(Integer decimalNumber) {
        // 使用Integer.toHexString确保得到正确的十六进制表示
        String hex = Integer.toHexString(decimalNumber);

        return hex.toString();
    }

    public static String convertDecimalToHexBigEndian(Float  decimalNumber) {
        long bits = Float.floatToRawIntBits(decimalNumber); // 获取浮点数的位表示
        String hexRepresentation = Long.toHexString(bits); // 转换为十六进制字符串
        return hexRepresentation.toString();
    }

    public static String convertDecimalToHexBigEndian(Double  decimalNumber) {
        long bits = Double.doubleToLongBits(decimalNumber);
        String hexRepresentation = Long.toHexString(bits); // 转换为十六进制字符串
        return hexRepresentation.toString();
    }

    public static String convertDecimalToHexBigEndian(Long  decimalNumber) {
        String hexRepresentation = Long.toHexString(decimalNumber); // 转换为十六进制字符串
        return hexRepresentation.toString();
    }
    public static String convertDecimalToHexBigEndian(Character  decimalNumber) {
        long bits = Double.doubleToLongBits(decimalNumber);
        String hexRepresentation = Long.toHexString(bits); // 转换为十六进制字符串
        // 转换为十六进制字符串
        return hexRepresentation.toString();
    }








}
